package edu.zzti.fruit1;

import edu.zzti.fruit.Average;

import java.util.Scanner;
import java.lang.String;

public class test {
    public static void main(String[] args) {

        Apple a1 = new Apple();
        Banana b1 = new Banana();
        Mango m1 = new Mango();
        Average1 f3 = new Average1();
        System.out.print("请输入Apple的质量和颜色：");
        Scanner input=new Scanner(System.in);
        float wt1=input.nextFloat();
        String cr1=input.next();
        a1.setWeight(wt1);
        a1.setColor(cr1);

        System.out.print("请输入Banana的质量和颜色：");
        float wt2=input.nextFloat();
        String cr2=input.next();
        b1.setWeight(wt2);
        b1.setColor(cr2);

        System.out.print("请输入Mango的质量和颜色：");
        float wt3=input.nextFloat();
        String cr3=input.next();
        m1.setWeight(wt3);
        m1.setColor(cr3);
        System.out.println();

        System.out.println("水果Apple的质量:"+a1.getWeight()+"     水果Apple的颜色:"+a1.getColor());
        System.out.println("水果Banana的质量:"+b1.getWeight()+"    水果Banana的颜色:"+b1.getColor());
        System.out.println("水果Mango的质量:"+m1.getWeight()+"     水果Mango的颜色:"+m1.getColor());

        float avr = f3.average(a1,b1,m1);
        System.out.println("三种水果质量的平均值为："+avr);

        input.close();
    }
}
